﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Transactions {
    import Engine.Transactions.*;
    import Classes.*;
    import Classes.orders.*;

    public class TPerformVisitorHelp extends Transaction {

        private var m_visitorHelpOrder:VisitorHelpOrder;
        private var m_type:String;
        private var m_gameObj:GameObject;

        public function TPerformVisitorHelp(_arg1:String, _arg2:GameObject, _arg3:String){
            var _local4:uint = _arg2.getId();
            this.m_gameObj = _arg2;
            this.m_visitorHelpOrder = new VisitorHelpOrder(_arg1, Global.player.snUser.uid, [_local4], OrderStatus.SENT);
            this.m_type = _arg3;
            Global.world.orderMgr.placeOrder(this.m_visitorHelpOrder);
            super();
        }
        public function getHelpType():String{
            return (this.m_type);
        }
        public function getGameObject():GameObject{
            return (this.m_gameObj);
        }
        override public function perform():void{
            if (Global.world.mostFrequentHelpers[("i" + Global.player.snUser.uid)]){
                var _local1 = Global.world.mostFrequentHelpers[("i" + Global.player.snUser.uid)];
                var _local2 = 2;
                var _local3 = (_local1[_local2] + 1);
                _local1[_local2] = _local3;
            } else {
                Global.world.mostFrequentHelpers[("i" + Global.player.snUser.uid)] = [Global.player.name, Global.player.cityName, 1];
            };
            signedCall("VisitorService.help", "visitorHelp", this.m_type, this.m_visitorHelpOrder.getParams());
        }
        override protected function onComplete(_arg1:Object):void{
        }

    }
}//package Transactions 
